package com.cdd.index.controller;

import com.cdd.index.service.IHeadNavService;
import com.cdd.index.vo.HeadNavVo;
import com.common.entity.HeadNav;
import com.common.untils.CommonResult;
import com.common.vo.PageVo;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lzl
 * @since 2022-09-02
 */
@RestController
@RequestMapping("/index/headNav")
public class HeadNavController {

    @Autowired
    private IHeadNavService headNavService;
    @PostMapping("/selectAll/{currentPage}/{pageSize}")
    public CommonResult selectAll(@PathVariable Integer currentPage,@PathVariable Integer pageSize,@RequestBody HeadNav headNav){
        return headNavService.selectAll(currentPage,pageSize,headNav);
    }
    @PostMapping("/findAll")
    public CommonResult findAll(){
        return headNavService.findAll();
    }

    @PostMapping("/headNavAdd")
    public CommonResult headNavAdd(@RequestBody HeadNav ruleForm){
        return headNavService.headNavAdd(ruleForm);
    }
    @PostMapping("/deleteHead/{headId}")
    public CommonResult deleteHead(@PathVariable Integer headId){
        return headNavService.deleteHead(headId);
    }

    @PostMapping("/update")
    public CommonResult update(@RequestBody HeadNav headNav){
        return headNavService.update(headNav);
    }
    @PostMapping("/updateStatus/{headId}/{isDiable}")
    public CommonResult updateStatus(@PathVariable Integer headId,@PathVariable String isDiable){
        return headNavService.updateStatus(headId,isDiable);

    }


}
